if(DEFINED ENV{ASCEND_DEPEND_FAISS_DIR})
    message("ASCEND_DEPEND_FAISS_DIR: $ENV{ASCEND_DEPEND_FAISS_DIR}")
else()
    message(FATAL_ERROR "NOT DEFINED ASCEND_DEPEND_FAISS_DIR VARIABLES")
endif()

if(DEFINED ENV{MX_INDEX_HOME})
    message("MX_INDEX_HOME: $ENV{MX_INDEX_HOME}")
else()
    message(FATAL_ERROR "NOT DEFINED MX_INDEX_HOME VARIABLES")
endif()

SET(ASCEND_HOME              /usr/local/Ascend          CACHE STRING   "")
IF (NOT DEFINED ASCEND_TOOLKIT_PATH)
    SET(ASCEND_TOOLKIT_PATH /usr/local/Ascend/ascend-toolkit/latest)
ENDIF()

include_directories(
    $ENV{ASCEND_DEPEND_FAISS_DIR}/include/
    ${ASCEND_TOOLKIT_PATH}/include
    ${ASCEND_HOME}/driver/include/dvpp
    $ENV{MX_INDEX_HOME}/mxIndex/include/
)

link_directories(
    $ENV{ASCEND_DEPEND_FAISS_DIR}/lib/
    ${ASCEND_TOOLKIT_PATH}/lib64
    $ENV{MX_INDEX_HOME}/mxIndex/host/lib/
)

set(ASCEND_LIBS faiss ascendcl c_sec ock_hmm ascendsearch ascendfaiss)
